#ifndef AVALON_SERVERCONNECTION_HPP
#define AVALON_SERVERCONNECTION_HPP
#include "Avalon/IO/Connection.hpp"
#include "Avalon/Threading/Async.hpp"

namespace Avalon {
namespace IO {

  /*! \class ServerConnection
   *  \brief Interface for the server side of a Connection.
   *  \author Kamal Mansouri <kranar@hotmail.com>
   */
  class ServerConnection : public Connection {
    public:

      virtual ~ServerConnection();

      //! Starts the ServerConnection.
      /*!
        \throw IOException if an IO operation fails.
      */
      virtual void Start() = 0;

      //! Accepts a Connection.
      /*!
        \return A Channel containing the Connection.
        \throw IOException if the connection failed.
      */
      virtual Threading::Async<Channel*>::Ptr Accept() = 0;
  };
}
}

#endif // AVALON_SERVERCONNECTION_HPP
